package main

import (
	"cobra_demo/cmd/appf"
	"cobra_demo/cmd/apps"
	"fmt"
	"github.com/spf13/cobra"
	"github.com/spf13/viper"
)

func main() {
	fmt.Println("hello cobra")
	root := &cobra.Command{
		Use: "cdemo",
	}
	root.AddCommand(appf.NewRootCommand())
	root.AddCommand(apps.NewRootCommand())
	viper.AutomaticEnv()
	keys := viper.AllKeys()
	for _, key := range keys {
		fmt.Printf("viper:%v", key)
	}
	if err := root.Execute(); err != nil {
		fmt.Printf("exit:%v", err)
	}
}
